/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javalens.astronomy;

import javalens.util.Position;

/** Container for parameters decribing source x- and y-position using the units and 
 * parameterization decribed by Asada.
 *
 * @author Pierre
 */
public class AsadaPositionParameters {

    private double nu;
    private double l;
    private double rho;
    private double c;
    private double s;

    public AsadaPositionParameters(Position source, Event event) {
	// scaling factor for all asada lengths
	// Set M1 = 1, M2 = q
	// Also, sx and sy will have to change
	double q = event.getQ();
	double scale = Math.sqrt(1.0+q);
        double a = event.getA();
        double sx = source.getX();
        double sy = source.getY();

	nu = q/(1.0+q);
	l = a/scale;
	rho = Math.sqrt(sx*sx + sy*sy)/scale;
	c = sx/rho/scale;
	s = sy/rho/scale;
    }
    
    public double getC() {
        return c;
    }

    public void setC(double c) {
        this.c = c;
    }

    public double getL() {
        return l;
    }

    public void setL(double l) {
        this.l = l;
    }

    public double getNu() {
        return nu;
    }

    public void setNu(double nu) {
        this.nu = nu;
    }

    public double getRho() {
        return rho;
    }

    public void setRho(double rho) {
        this.rho = rho;
    }

    public double getS() {
        return s;
    }

    public void setS(double s) {
        this.s = s;
    }
}
